<?php
/**
 * Created by 张彪.
 * User: 小马出行
 * Date: 2017/11/2
 * Time: 14:56
 */
namespace app\inter\model;
use \think\Model;
use think\Db;
class OrderCommentModel extends Model
{
    public function getOrderComment($map=array(),$field='*',$flag=true,$order='comment_id desc',$page=1,$limit=10)
    {
        return $flag ? Db::name('order_comment')->where($map)->field($field)->order($order)->page($page,$limit)->select()
            :Db::name('order_comment')->where($map)->field($field)->find();
    }

    public function addOrderComment($data)
    {
        return Db::name('order_comment')->insertGetId($data);
    }

    public function orderCommentCount($map)
    {
        return Db::name('order_comment')->where($map)->count();
    }
}